
/*
 * @Author: 于建霞
 * @Date: 2020-11-We 10:11:35
 * @Last Modified by:   于建霞
 * @Last Modified time: 2020-11-We 10:11:35
 * 
 * * @description:  旅客改签弹框
 */

import React, { useState, useCallback, useRef, useEffect } from 'react';
import { Modal, Button, Card, Form, Input, Select } from 'antd';
import { useRequest } from '@umijs/hooks';
import styles from './index.less';


// 自定义组件
import PassengerList from './passengerList'; //旅客列表
import FlightList from './flightList'; //航班列表

const { Option } = Select;
const { TextArea } = Input;
const SMSNotice = (props) => {
    const { form: { getFieldDecorator, validateFields },
        endorseVisible,
        setEndorseVisible
    } = props;
    // 短信模板选择
    const handleSelectChange = (val) => {
        console.log('短信模板选择', val)
    }
    // 发送
    const handleOk = () => {
        console.log('提交 :>> ',);
        validateFields((err, values) => {
            if (!err) {
                console.log('Received values of form: ', values);
            }
        });
    }
    // 取消
    const handleCancel = () => {
        setEndorseVisible(false);
    }

    return (
        <Modal
            title="旅客改签"
            visible={endorseVisible}
            maskClosable={false}
            onOk={handleOk}
            destroyOnClose={true}
            width="80%"
            okText="发送"
            onCancel={handleCancel}
        >
            {/* 收件人 */}
            <Card
                title="改签旅客信息"
                style={{ width: '100%', }}
                hoverable={true}
                headStyle={{ backgroundColor: "#FAFAFA" }}
                bodyStyle={{ padding: 12, }}
            > 
                <PassengerList />
            </Card>
            {/* 短信模板 */}
            <Card
                title="改签航班信息"
                style={{ width: '100%', height: "200" }}
                hoverable={true}
                style={{ marginTop: "30px" }}
                className={styles.smsModal}
                headStyle={{ backgroundColor: "#FAFAFA" }}
                bodyStyle={{ padding: 12, }}
            >
                <FlightList />
            </Card>
        </Modal>
    )
}

export default Form.create()(SMSNotice);